<?php $this->load->view("common/page_header");?>
<div id="body_main">
	<div id="admin_header">
		<?php $this->load->view('common/admin_header'); ?>
		<div class="top_cleft">
			<ul>
				<li><a href="/console/settings/">基本控制</a></li>
				<li class="current"><a href="/console/settings/ip_forbidden">访问控制</a></li>
			</ul>
			<div class="clear"></div>
		</div>
	</div>
	<div id="admin_content">
		<div id="admin_navigator">
			<ul class="navigator">
				<li class="current"><a href="/console/settings/ip_forbidden">禁访ip</a></li>
				<li><a href="/console/settings/ip_permission">后台访问</a></li>
			</ul>
		</div>
		<div id="admin_body">
			<form method="post">
				<table class="b_table text_left_table" id="ip_forbidden_table" width="100%">
					<tr>
						<th width="40%">禁访ip</th>
						
					</tr>
					<?php if (!empty($ips)) {?>
					<?php foreach($ips as $ip) { ?>
					<tr id="ip-<?php  echo $ip['id'];?>">
						<td>
							<?php echo $ip['ip']?>
							<a sid="<?php echo $ip['id'];?>" href="javascript:void(0)" class="red margin_left15 delete" style="font-size:18px">&times;</a>
						</td>
						
					</tr>
					<?php } ?>
					<?php }?>
					<tr>
						<td colspan="2">
							<input name="ip" type="text" style="width:250px;" name="ip"/>&nbsp;&nbsp;
							<input type="submit" class="input_button" value="新增"/>
						</td>
					</tr>
				</table>
			</form>
			
		</div>
		<div class="clear"></div>
	</div>
	<?php $this->load->view("common/footer");?>	
</div>
<script type="text/javascript">
$(document).ready(function(){
	$(".delete").click(function() {
		id = $(this).attr("sid");
		$.get('/console/settings/ip_forbidden_delete?id=' + id, function(data) {
			  if (data == 1) {
				  $('#ip-' + id).fadeOut('slow');
			  }
			});

	});
	
});
</script>	
<?php $this->load->view("common/page_footer");?>